package com.dayuanit.dy8.model.outmemery;

import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) {
//        Test.a();//Exception in thread "main" java.lang.StackOverflowError

        //byte[] buf = new byte[Integer.MAX_VALUE];//Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
        List list = new ArrayList();//Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        for (;;) {
            list.add(new Object());
        }
    }

    static void a() {
        b();
    }

    static void b() {
        a();
    }
}
